import Vue from 'vue'
import Vuex from 'vuex'
import products from './modules/products'
Vue.use(Vuex)

// initial state
const state = {
  username: 'Default User'
}

// getters
const getters = {
  getUsername: (state) => state.username
}

// actions
const actions = {

}

// mutations
const mutations = {
  setUsername(state, name) {
    state.username = name;
  }
}

export default new Vuex.Store({
  state,
  getters,
  actions,
  mutations,
  modules: {
    products
  }
})
